<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_articles_category
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

//if(in_array($this->category->id, array(8, 9, 10))) {
//var_dump($params);
?>
<?php foreach ($list as $num => $item) :  ?>
	 <div class="thangcanh-1">
			<?php if(true) {
				//code lay hinh
				$arr2 = preg_split('/<(IMG|img) /', $item->l_introtext);
				//if(sizeof($arr2) <= 1) return '';
				$arr3 = preg_split('/src=\"/', $arr2[1]);
				//if(sizeof($arr3) <= 1) return '';
				$arr4 = preg_split('/\"/', $arr3[1]);
				if(preg_match('/http:/', $arr4[0]))
				{
				    $result = $arr4[0];
				}
				else if(preg_match('/^\//', $arr4[0])){
				    $result = $u2 . substr($arr4[0],1);
				}
				else
				{
				    for($ei = 3; $ei < sizeof($u1) - 1; $ei++)
				    {
					$u2 .= $u1[$ei] . "/";
				    }
				    $result = $u2 . $arr4[0];
				    //if($result == "") $result = JURI::base()."/templates/kdtt/images/noimage50.gif";
				}
				
			?>
			<div class="photo-1">
			<?php if($result != "") { ?>
						<a href="<?php echo $item->link; ?>" class="">
							<img src="<?php echo $result ?>" alt="<?php echo $item->title; ?>" title="<?php echo $item->title; ?>"  class="" width="120" height="70"/>
						</a>
			<?php } ?>				
			</div>	
			<h3><a href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a></h3>				
			<p>
			<?php
				$arr = explode(" ", strip_tags($item->introtext));
				if(count($arr) >= 22)
				{
					$item->sintrotext = "";
					for($i=0; $i < 22; $i++)
					{
						$item->sintrotext .= $arr[$i]." ";
					}
					$item->sintrotext .= "...";
				}
				else $item->sintrotext = strip_tags($item->introtext);
				$item->sintrotext = str_replace("\"", "", $item->sintrotext); 
				
				echo $item->sintrotext;
				
				?>
			</p>
			<?php } ?>
	  </div>
	  
		<?php endforeach; ?>
    
<?php //} ?>
